package com.zeldu.course.service.impl;

import com.zeldu.course.mapper.CourseMapper;
import com.zeldu.course.pojo.Course;
import com.zeldu.course.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Service
public class CourseServiceImpl implements CourseService{
    @Autowired(required = false)
    private CourseMapper courseMapper;

    @Override
    public List<Course> queryStudentAll(Long studentId) {
        return courseMapper.queryStudentAll(studentId);
    }

    @Override
    public Course detail(int id) {
        return courseMapper.detail(id);
    }

    @Override
    public int join(@RequestBody Course course) {
        return courseMapper.join(course);
    }

    @Override
    public int exist(@RequestBody Course course) {
        return courseMapper.exist(course);
    }

    @Override
    public int available(int courseId) {
        return courseMapper.available(courseId);
    }

    @Override
    public int create(@RequestBody Course course) {
        return courseMapper.create(course);
    }

    @Override
    public List<Course> queryTeacherAll(Long teacherId) {
        return courseMapper.queryTeacherAll(teacherId);
    }

    @Override
    public List<Course> showClass(Long teacherId) {
        return courseMapper.showClass(teacherId);
    }

    @Override
    public List<Course> queryStudentsId(int courseId) {
        return courseMapper.queryStudentsId(courseId);
    }
}
